def my_sum(arr):
    total = 0
    for x in arr:
        total += x
    return total


print(my_sum([2, 4, 6]))


def sum_r(arr):
    if len(arr) == 0:
        return 0
    num = arr[0]
    arr.pop(0)
    return num + sum_r(arr)


print(sum_r([2, 4, 6, 8]))
